<?php
declare(strict_types=1);

namespace App\Exception\Handler;


use App\Traits\ApiResponseTrait;
use Hyperf\ExceptionHandler\ExceptionHandler;
use Psr\Http\Message\ResponseInterface;
use Throwable;

class HttpExceptionHandler extends ExceptionHandler
{
    use ApiResponseTrait;
   public function handle(Throwable $throwable, ResponseInterface $response)
   {
       return $this->fail($throwable->getMessage());
   }

   public function isValid(Throwable $throwable): bool
   {
       return  true;
   }
}